($ => {
    // <summary>
    // 获取注册页面的工具栏配置
    // params: json自定义参数
    // </summary>
    $.getStatisticTools = ($eventEmitter, quickFilter, examGrid, params) => {
        const handleClick = (toolId, data) => {
            $eventEmitter.trigger(toolId, {
                quickFilter,
                examGrid,
                params,
                data
            });
        };
        const tool = {
            // 刷新
            refresh: {
                widget: 'dxButton',
                location: 'after',
                options: {
                    text: '刷新',
                    icon: 'refresh',
                    focusStateEnabled: false,
                    onClick: () => {
                        handleClick('refresh');
                    },
                },
            },
            export: {
                widget: 'dxButton',
                location: 'before',
                name: '统计_导出列表',
                options: {
                    text: '导出列表',
                    icon: 'export',
                    focusStateEnabled: false,
                    onClick: () => {
                        handleClick('export');
                    },
                }
            }
        };
        for (const property in tool) {
            const item = tool[property];
            if (item.name) {
                item.visible = item.visible || (ris.verify(item.name) && item.visible !== false);
            }
            if (item.options) {
                if (item.hasOwnProperty('visible')) {
                    item.options.visible = item.visible;
                }
            }
        }
        return { ...tool };
    };
})(jQuery);
